/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('dyvmsapi-intl', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model BackendCallGroupRequest {
  calledNumber?: [ string ](name='CalledNumber', description='The called numbers. You can specify up to 50,000 phone numbers.'),
  callerIdNumber?: string(name='CallerIdNumber', description='The calling number.

If you do not specify this parameter, the system uses a local random number as the display number. If you use a dedicated number for outbound calls, you must specify the purchased number. You can specify only one number. You can log on to the VMS console and choose Number Management to view the purchased phone numbers.', example='852****1111'),
  countryId?: string(name='CountryId', description='The ISO2 country code.', example='HK'),
  outId?: string(name='OutId', description='The ID reserved for the caller. This ID is returned to the caller in a receipt message.

The value must be of the STRING type and 1 to 15 bytes in length.', example='22596****'),
  ownerId?: long(name='OwnerId'),
  playTimes?: long(name='PlayTimes', description='The number of times the audio file is played. Valid values: 1 to 3.', example='1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendType?: long(name='SendType', description='The delivery type. Valid values: 1 and 2.

1: The audio file is delivered immediately.

2: The audio file is delivered at a scheduled time. If you specify SendType as 2, you must specify TimingStart.', example='2'),
  speed?: long(name='Speed', description='The playback speed. Valid values: -500 to 500.

You must specify this parameter when the audio type is text-to-speech (TTS). You do not need to specify this parameter when you use recordings.', example='0'),
  taskName?: string(name='TaskName', description='The task name.'),
  timingStart?: string(name='TimingStart', description='The time when the audio file is scheduled to be delivered.', example='2022-05-01T08:00:00+08:00'),
  ttsCode?: string(name='TtsCode', description='The voice template ID of the audio file.

You can log on to the VMS console and choose Voice Call Template > Audio File to view the template ID.

You must specify either TtsCode or VoiceCode. You can specify TtsCode to use the audio file as the call content. Alternatively, you can specify VoiceCode to use preset text as the call content.', example='100001'),
  voiceCode?: string(name='VoiceCode', description='The TTS template ID.

You can log on to the VMS console and choose Voice Call Template > TTS Template to view the template ID.

You must specify either TtsCode or VoiceCode. You can specify TtsCode to use the audio file as the call content. Alternatively, you can specify VoiceCode to use preset text as the call content.', example='200001'),
  volume?: long(name='Volume', description='The playback volume of the audio file. Valid values: 0 to 100. Default value: 100.', example='100'),
}

model BackendCallGroupShrinkRequest {
  calledNumberShrink?: string(name='CalledNumber', description='The called numbers. You can specify up to 50,000 phone numbers.'),
  callerIdNumber?: string(name='CallerIdNumber', description='The calling number.

If you do not specify this parameter, the system uses a local random number as the display number. If you use a dedicated number for outbound calls, you must specify the purchased number. You can specify only one number. You can log on to the VMS console and choose Number Management to view the purchased phone numbers.', example='852****1111'),
  countryId?: string(name='CountryId', description='The ISO2 country code.', example='HK'),
  outId?: string(name='OutId', description='The ID reserved for the caller. This ID is returned to the caller in a receipt message.

The value must be of the STRING type and 1 to 15 bytes in length.', example='22596****'),
  ownerId?: long(name='OwnerId'),
  playTimes?: long(name='PlayTimes', description='The number of times the audio file is played. Valid values: 1 to 3.', example='1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendType?: long(name='SendType', description='The delivery type. Valid values: 1 and 2.

1: The audio file is delivered immediately.

2: The audio file is delivered at a scheduled time. If you specify SendType as 2, you must specify TimingStart.', example='2'),
  speed?: long(name='Speed', description='The playback speed. Valid values: -500 to 500.

You must specify this parameter when the audio type is text-to-speech (TTS). You do not need to specify this parameter when you use recordings.', example='0'),
  taskName?: string(name='TaskName', description='The task name.'),
  timingStart?: string(name='TimingStart', description='The time when the audio file is scheduled to be delivered.', example='2022-05-01T08:00:00+08:00'),
  ttsCode?: string(name='TtsCode', description='The voice template ID of the audio file.

You can log on to the VMS console and choose Voice Call Template > Audio File to view the template ID.

You must specify either TtsCode or VoiceCode. You can specify TtsCode to use the audio file as the call content. Alternatively, you can specify VoiceCode to use preset text as the call content.', example='100001'),
  voiceCode?: string(name='VoiceCode', description='The TTS template ID.

You can log on to the VMS console and choose Voice Call Template > TTS Template to view the template ID.

You must specify either TtsCode or VoiceCode. You can specify TtsCode to use the audio file as the call content. Alternatively, you can specify VoiceCode to use preset text as the call content.', example='200001'),
  volume?: long(name='Volume', description='The playback volume of the audio file. Valid values: 0 to 100. Default value: 100.', example='100'),
}

model BackendCallGroupResponseBody = {
  code?: string(name='Code', description='The response code.

The value OK indicates that the request was successful. Other values indicate that the request failed. For more information, see Error codes.', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='E50FFA85-0B79-4421-A7BD-00B0A271966F'),
  taskId?: string(name='TaskId', description='The task ID. You can use this ID to query the details of the task.', example='550e8400-e29b-41d4-a716-446655440000'),
}

model BackendCallGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BackendCallGroupResponseBody(name='body'),
}

/**
 * @summary Initiates a voice group call to multiple phone numbers. The content of the group call is that of approved templates. You can log on to the VMS console and choose Voice Call Template to view the template ID. This feature enqueues the phone numbers to be called. The time when the phone numbers are called is uncertain.
 *
 * @param tmpReq BackendCallGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BackendCallGroupResponse
 */
async function backendCallGroupWithOptions(tmpReq: BackendCallGroupRequest, runtime: Util.RuntimeOptions): BackendCallGroupResponse {
  Util.validateModel(tmpReq);
  var request = new BackendCallGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.calledNumber)) {
    request.calledNumberShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.calledNumber, 'CalledNumber', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.calledNumberShrink)) {
    query['CalledNumber'] = request.calledNumberShrink;
  }
  if (!Util.isUnset(request.callerIdNumber)) {
    query['CallerIdNumber'] = request.callerIdNumber;
  }
  if (!Util.isUnset(request.countryId)) {
    query['CountryId'] = request.countryId;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.playTimes)) {
    query['PlayTimes'] = request.playTimes;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sendType)) {
    query['SendType'] = request.sendType;
  }
  if (!Util.isUnset(request.speed)) {
    query['Speed'] = request.speed;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.timingStart)) {
    query['TimingStart'] = request.timingStart;
  }
  if (!Util.isUnset(request.ttsCode)) {
    query['TtsCode'] = request.ttsCode;
  }
  if (!Util.isUnset(request.voiceCode)) {
    query['VoiceCode'] = request.voiceCode;
  }
  if (!Util.isUnset(request.volume)) {
    query['Volume'] = request.volume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BackendCallGroup',
    version = '2021-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Initiates a voice group call to multiple phone numbers. The content of the group call is that of approved templates. You can log on to the VMS console and choose Voice Call Template to view the template ID. This feature enqueues the phone numbers to be called. The time when the phone numbers are called is uncertain.
 *
 * @param request BackendCallGroupRequest
 * @return BackendCallGroupResponse
 */
async function backendCallGroup(request: BackendCallGroupRequest): BackendCallGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return backendCallGroupWithOptions(request, runtime);
}

model BackendCallSignalRequest {
  calledNumber?: string(name='CalledNumber', description='The phone number that receives the voice notification.

You must add the country code to the beginning of the phone number. Example: 85200\\\\*\\\\*\\\\*\\\\*00.', example='852****0000'),
  callerIdNumber?: string(name='CallerIdNumber', description='The calling number.

If you do not specify this parameter, the system uses a local random number as the display number. If you use a dedicated number for outbound calls, you must specify the purchased number. You can specify only one number. You can log on to the VMS console and choose Number Management to view the purchased phone numbers.', example='852****0000'),
  countryId?: string(name='CountryId', description='The ISO2 country code.', example='HK'),
  outId?: string(name='OutId', description='The ID reserved for the caller. This ID is returned to the caller in a receipt message.

The value must be of the STRING type and 1 to 15 bytes in length.', example='22522****'),
  ownerId?: long(name='OwnerId'),
  playTimes?: long(name='PlayTimes', description='The number of times the voice notification is played back in a call. Valid values: 1 to 3. Default value: 3.', example='2'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  speed?: long(name='Speed', description='The playback speed. Valid values: -500 to 500.', example='0'),
  ttsCode?: string(name='TtsCode', description='The ID of the approved voice verification code template.

You can log on to the VMS console and choose Voice Call Template to view the template ID.', example='1001'),
  ttsParam?: string(name='TtsParam', description='The variables in the template, in the JSON format.', example='{"code":"1234"}'),
  volume?: long(name='Volume', description='The playback volume of the voice notification. Valid values: 0 to 100. Default value: 100.', example='100'),
}

model BackendCallSignalResponseBody = {
  callId?: string(name='CallId', description='The unique receipt ID for the call. You can use this ID to query the details of a single call.', example='550e8400-e29b-41d4-a716-446655440000'),
  code?: string(name='Code', description='The response code.

The value OK indicates that the request was successful. Other values indicate that the request failed. For more information, see Error codes.', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
}

model BackendCallSignalResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BackendCallSignalResponseBody(name='body'),
}

/**
 * @summary Sends a voice verification code and voice notification with variables to a phone number.
 *
 * @param request BackendCallSignalRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BackendCallSignalResponse
 */
async function backendCallSignalWithOptions(request: BackendCallSignalRequest, runtime: Util.RuntimeOptions): BackendCallSignalResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.callerIdNumber)) {
    query['CallerIdNumber'] = request.callerIdNumber;
  }
  if (!Util.isUnset(request.countryId)) {
    query['CountryId'] = request.countryId;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.playTimes)) {
    query['PlayTimes'] = request.playTimes;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.speed)) {
    query['Speed'] = request.speed;
  }
  if (!Util.isUnset(request.ttsCode)) {
    query['TtsCode'] = request.ttsCode;
  }
  if (!Util.isUnset(request.ttsParam)) {
    query['TtsParam'] = request.ttsParam;
  }
  if (!Util.isUnset(request.volume)) {
    query['Volume'] = request.volume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BackendCallSignal',
    version = '2021-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Sends a voice verification code and voice notification with variables to a phone number.
 *
 * @param request BackendCallSignalRequest
 * @return BackendCallSignalResponse
 */
async function backendCallSignal(request: BackendCallSignalRequest): BackendCallSignalResponse {
  var runtime = new Util.RuntimeOptions{};
  return backendCallSignalWithOptions(request, runtime);
}

model GroupCallRequest {
  calledNumber?: [ string ](name='CalledNumber', description='被叫号码。上限为5万个。'),
  callerIdNumber?: string(name='CallerIdNumber', description='主叫号码。  若您不填该参数，系统将会使用当地随机号码作为外显号码。 若您专属号码外呼，则必须传入已购买的号码，仅支持一个号码。您可以登录国际语音服务控制台，选择"号码管理"查看已购买的号码。', example='852****1111'),
  countryId?: string(name='CountryId', description='国家/地区二字码，ISO2。', example='HK'),
  outId?: string(name='OutId', description='预留给调用方使用的ID，最终会通过在回执消息中将此ID带回给调用方。  字符串类型，长度为1~15个字节。', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  playTimes?: long(name='PlayTimes', description='语音文件的播放次数。取值范围：1~3。', example='1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendType?: long(name='SendType', description='发送类型：取值[1,2]。  1： 立即开始发送任务，不等待。  2： 定时开始发送任务。如果传该类型，TimingStart为必选字段。', example='3'),
  signature?: string(name='Signature', example='s****************D'),
  signatureNonce?: string(name='SignatureNonce', example='l*********y'),
  speed?: long(name='Speed', description='语速控制，取值范围：-500~500。  音频类型为TTS时必传。录音文件可不传。', example='94'),
  taskName?: string(name='TaskName', description='任务名称。', example='群呼任务'),
  timestamp?: string(name='Timestamp', example='20**-**-******10Z'),
  timingStart?: string(name='TimingStart', description='2022-05-01T08:00:00+08:00', example='定时发送的时间。'),
  ttsCode?: string(name='TtsCode', description='文本转语音的模板ID。  您可以登录国际语音服务控制台，选择"语音模板管理"-"文本转语音模板"，查看模板ID。  此参数与VoiceCode二选一必填。分别代表使用语音文件作为呼叫内容呼叫或者使用固定模板文字作为呼叫内容。', example='1****01'),
  ttsParam?: string(name='TtsParam', description='模板中的变量参数，JSON格式。', example='{"code":"1234"}'),
  voiceCode?: string(name='VoiceCode', description='语音文件的模板ID。  您可以登录国际语音服务控制台，选择"语音模板管理"-"语音文件"，查看模板ID。  此参数与TtsCode二选一必填。分别代表使用语音文件作为呼叫内容呼叫或者使用固定模板文字作为呼叫内容。', example='2*****01'),
  volume?: long(name='Volume', description='语音文件播放的音量。取值范围：0~100，默认取值100。', example='11'),
}

model GroupCallShrinkRequest {
  calledNumberShrink?: string(name='CalledNumber', description='被叫号码。上限为5万个。'),
  callerIdNumber?: string(name='CallerIdNumber', description='主叫号码。  若您不填该参数，系统将会使用当地随机号码作为外显号码。 若您专属号码外呼，则必须传入已购买的号码，仅支持一个号码。您可以登录国际语音服务控制台，选择"号码管理"查看已购买的号码。', example='852****1111'),
  countryId?: string(name='CountryId', description='国家/地区二字码，ISO2。', example='HK'),
  outId?: string(name='OutId', description='预留给调用方使用的ID，最终会通过在回执消息中将此ID带回给调用方。  字符串类型，长度为1~15个字节。', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  playTimes?: long(name='PlayTimes', description='语音文件的播放次数。取值范围：1~3。', example='1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendType?: long(name='SendType', description='发送类型：取值[1,2]。  1： 立即开始发送任务，不等待。  2： 定时开始发送任务。如果传该类型，TimingStart为必选字段。', example='3'),
  signature?: string(name='Signature', example='s****************D'),
  signatureNonce?: string(name='SignatureNonce', example='l*********y'),
  speed?: long(name='Speed', description='语速控制，取值范围：-500~500。  音频类型为TTS时必传。录音文件可不传。', example='94'),
  taskName?: string(name='TaskName', description='任务名称。', example='群呼任务'),
  timestamp?: string(name='Timestamp', example='20**-**-******10Z'),
  timingStart?: string(name='TimingStart', description='2022-05-01T08:00:00+08:00', example='定时发送的时间。'),
  ttsCode?: string(name='TtsCode', description='文本转语音的模板ID。  您可以登录国际语音服务控制台，选择"语音模板管理"-"文本转语音模板"，查看模板ID。  此参数与VoiceCode二选一必填。分别代表使用语音文件作为呼叫内容呼叫或者使用固定模板文字作为呼叫内容。', example='1****01'),
  ttsParam?: string(name='TtsParam', description='模板中的变量参数，JSON格式。', example='{"code":"1234"}'),
  voiceCode?: string(name='VoiceCode', description='语音文件的模板ID。  您可以登录国际语音服务控制台，选择"语音模板管理"-"语音文件"，查看模板ID。  此参数与TtsCode二选一必填。分别代表使用语音文件作为呼叫内容呼叫或者使用固定模板文字作为呼叫内容。', example='2*****01'),
  volume?: long(name='Volume', description='语音文件播放的音量。取值范围：0~100，默认取值100。', example='11'),
}

model GroupCallResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='""'),
  code?: string(name='Code', description='请求状态码。  返回OK代表请求成功。 其他错误码，请参见API错误码。', example='OK'),
  message?: string(name='Message', description='返回信息描述', example='OK'),
  model?: {
    taskId?: string(name='TaskId', description='任务ID，可以通过此ID查询任务的详情。', example='550E****-****-****-****-********00A0'),
  }(name='Model'),
  requestId?: string(name='RequestId', description='请求ID', example='E50F****-****-****-****-********966F'),
}

model GroupCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GroupCallResponseBody(name='body'),
}

/**
 * @summary 向指定号码发送语音验证码和带参数变量的语音通知，支持语音文件模板或文本转语音模板
 *
 * @param tmpReq GroupCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GroupCallResponse
 */
async function groupCallWithOptions(tmpReq: GroupCallRequest, runtime: Util.RuntimeOptions): GroupCallResponse {
  Util.validateModel(tmpReq);
  var request = new GroupCallShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.calledNumber)) {
    request.calledNumberShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.calledNumber, 'CalledNumber', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.calledNumberShrink)) {
    query['CalledNumber'] = request.calledNumberShrink;
  }
  if (!Util.isUnset(request.callerIdNumber)) {
    query['CallerIdNumber'] = request.callerIdNumber;
  }
  if (!Util.isUnset(request.countryId)) {
    query['CountryId'] = request.countryId;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.playTimes)) {
    query['PlayTimes'] = request.playTimes;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sendType)) {
    query['SendType'] = request.sendType;
  }
  if (!Util.isUnset(request.signature)) {
    query['Signature'] = request.signature;
  }
  if (!Util.isUnset(request.signatureNonce)) {
    query['SignatureNonce'] = request.signatureNonce;
  }
  if (!Util.isUnset(request.speed)) {
    query['Speed'] = request.speed;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.timestamp)) {
    query['Timestamp'] = request.timestamp;
  }
  if (!Util.isUnset(request.timingStart)) {
    query['TimingStart'] = request.timingStart;
  }
  if (!Util.isUnset(request.ttsCode)) {
    query['TtsCode'] = request.ttsCode;
  }
  if (!Util.isUnset(request.ttsParam)) {
    query['TtsParam'] = request.ttsParam;
  }
  if (!Util.isUnset(request.voiceCode)) {
    query['VoiceCode'] = request.voiceCode;
  }
  if (!Util.isUnset(request.volume)) {
    query['Volume'] = request.volume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GroupCall',
    version = '2021-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 向指定号码发送语音验证码和带参数变量的语音通知，支持语音文件模板或文本转语音模板
 *
 * @param request GroupCallRequest
 * @return GroupCallResponse
 */
async function groupCall(request: GroupCallRequest): GroupCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return groupCallWithOptions(request, runtime);
}

model SignalCallRequest {
  calledNumber?: string(name='CalledNumber', description='接收语音通知的手机号码。  号码格式：国际码+号码： 示例：85200****00。', example='852****0000'),
  callerIdNumber?: string(name='CallerIdNumber', description='主叫号码。  若您不填该参数，系统将会使用当地随机号码作为外显号码。 若您专属号码外呼，则必须传入已购买的号码，仅支持一个号码。您可以登录国际语音服务控制台，选择"号码管理"查看已购买的号码。', example='852****0001'),
  countryId?: string(name='CountryId', description='国家/地区二字码，ISO2。', example='HK'),
  outId?: string(name='OutId', description='预留给调用方使用的ID，最终会通过在回执消息中将此ID带回给调用方。  字符串类型，长度为1~15个字节。', example='22522****'),
  ownerId?: long(name='OwnerId'),
  playTimes?: long(name='PlayTimes', description='一通电话内语音通知内容的播放次数。取值范围：1~3，默认取值3。', example='2'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendType?: long(name='SendType', description='发送类型：取值[1,2]。  1： 立即开始发送任务，不等待。  2： 定时开始发送任务。如果传该类型，TimingStart为必选字段。', example='1'),
  signature?: string(name='Signature', example='9****************D'),
  signatureNonce?: string(name='SignatureNonce', example='l*********y'),
  speed?: long(name='Speed', description='语速控制。取值范围为：-500~500。', example='0'),
  taskName?: string(name='TaskName', description='任务名称。', example='单呼任务名'),
  timestamp?: string(name='Timestamp', example='20**-**-**T**%3A25%3A10Z'),
  timingStart?: string(name='TimingStart', description='定时发送的时间。', example='2022-05-01T08:00:00+08:00'),
  ttsCode?: string(name='TtsCode', description='文本转语音模板的语音ID。  您可以登录国际语音服务控制台，选择"语音模板管理"-"文本转语音模板"，查看模板ID。  此参数与VoiceCode二选一必填。分别代表使用语音文件作为呼叫内容呼叫或者使用固定模板文字作为呼叫内容。', example='1001'),
  ttsParam?: string(name='TtsParam', description='模板中的变量参数，JSON格式。', example='{"code":"1234"}'),
  voiceCode?: string(name='VoiceCode', description='语音文件的模板ID。  您可以登录国际语音服务控制台，选择"语音模板管理"-"语音文件"，查看模板ID。  此参数与TtsCode二选一必填。分别代表使用语音文件作为呼叫内容呼叫或者使用固定模板文字作为呼叫内容。', example='1002'),
  volume?: long(name='Volume', description='语音通知的播放音量。取值范围：0~100，默认取值100。', example='100'),
}

model SignalCallResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='""'),
  code?: string(name='Code', description='请求状态码。  返回OK代表请求成功。 其他错误码，请参见API错误码。', example='OK'),
  message?: string(name='Message', description='返回信息描述。', example='OK'),
  model?: {
    callId?: string(name='CallId', description='任务ID，可以通过此ID查询任务的详情。', example='550E****-****-****-****-********0CA0'),
  }(name='Model'),
  requestId?: string(name='RequestId', description='请求ID。', example='D9CB****-****-****-****-********9D23'),
  success?: boolean(name='Success', description='请求是否成功，成功：true，失败：false。', example='true'),
}

model SignalCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SignalCallResponseBody(name='body'),
}

/**
 * @summary 向指定号码发送语音验证码和带参数变量的语音通知，支持语音文件模板或文本转语音模板
 *
 * @param request SignalCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SignalCallResponse
 */
async function signalCallWithOptions(request: SignalCallRequest, runtime: Util.RuntimeOptions): SignalCallResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.callerIdNumber)) {
    query['CallerIdNumber'] = request.callerIdNumber;
  }
  if (!Util.isUnset(request.countryId)) {
    query['CountryId'] = request.countryId;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.playTimes)) {
    query['PlayTimes'] = request.playTimes;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sendType)) {
    query['SendType'] = request.sendType;
  }
  if (!Util.isUnset(request.signature)) {
    query['Signature'] = request.signature;
  }
  if (!Util.isUnset(request.signatureNonce)) {
    query['SignatureNonce'] = request.signatureNonce;
  }
  if (!Util.isUnset(request.speed)) {
    query['Speed'] = request.speed;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.timestamp)) {
    query['Timestamp'] = request.timestamp;
  }
  if (!Util.isUnset(request.timingStart)) {
    query['TimingStart'] = request.timingStart;
  }
  if (!Util.isUnset(request.ttsCode)) {
    query['TtsCode'] = request.ttsCode;
  }
  if (!Util.isUnset(request.ttsParam)) {
    query['TtsParam'] = request.ttsParam;
  }
  if (!Util.isUnset(request.voiceCode)) {
    query['VoiceCode'] = request.voiceCode;
  }
  if (!Util.isUnset(request.volume)) {
    query['Volume'] = request.volume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SignalCall',
    version = '2021-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 向指定号码发送语音验证码和带参数变量的语音通知，支持语音文件模板或文本转语音模板
 *
 * @param request SignalCallRequest
 * @return SignalCallResponse
 */
async function signalCall(request: SignalCallRequest): SignalCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return signalCallWithOptions(request, runtime);
}

model VoiceGroupCallRequest {
  calledNumber?: [ string ](name='CalledNumber'),
  callerIdNumber?: string(name='CallerIdNumber', example='852****1111'),
  countryId?: string(name='CountryId', example='HK'),
  outId?: string(name='OutId', example='22596****'),
  ownerId?: long(name='OwnerId'),
  playTimes?: long(name='PlayTimes', example='1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendType?: long(name='SendType', example='1'),
  speed?: long(name='Speed', example='100'),
  taskName?: string(name='TaskName', example='示例值示例值'),
  timingStart?: string(name='TimingStart', example='2022-05-01T08:00:00+08:00'),
  ttsCode?: string(name='TtsCode', example='1****01'),
  ttsParam?: string(name='TtsParam', example='{"code":"1234"}'),
  voiceCode?: string(name='VoiceCode', example='2*****01'),
  volume?: long(name='Volume', example='100'),
}

model VoiceGroupCallShrinkRequest {
  calledNumberShrink?: string(name='CalledNumber'),
  callerIdNumber?: string(name='CallerIdNumber', example='852****1111'),
  countryId?: string(name='CountryId', example='HK'),
  outId?: string(name='OutId', example='22596****'),
  ownerId?: long(name='OwnerId'),
  playTimes?: long(name='PlayTimes', example='1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendType?: long(name='SendType', example='1'),
  speed?: long(name='Speed', example='100'),
  taskName?: string(name='TaskName', example='示例值示例值'),
  timingStart?: string(name='TimingStart', example='2022-05-01T08:00:00+08:00'),
  ttsCode?: string(name='TtsCode', example='1****01'),
  ttsParam?: string(name='TtsParam', example='{"code":"1234"}'),
  voiceCode?: string(name='VoiceCode', example='2*****01'),
  volume?: long(name='Volume', example='100'),
}

model VoiceGroupCallResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='""'),
  code?: string(name='Code', example='OK'),
  message?: string(name='Message', example='OK'),
  model?: map[string]any(name='Model'),
  requestId?: string(name='RequestId', example='E50F****-****-****-****-********966F'),
  success?: boolean(name='Success', example='true'),
}

model VoiceGroupCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VoiceGroupCallResponseBody(name='body'),
}

/**
 * @summary 国际语音api-语音群呼
 *
 * @param tmpReq VoiceGroupCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return VoiceGroupCallResponse
 */
async function voiceGroupCallWithOptions(tmpReq: VoiceGroupCallRequest, runtime: Util.RuntimeOptions): VoiceGroupCallResponse {
  Util.validateModel(tmpReq);
  var request = new VoiceGroupCallShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.calledNumber)) {
    request.calledNumberShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.calledNumber, 'CalledNumber', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.calledNumberShrink)) {
    query['CalledNumber'] = request.calledNumberShrink;
  }
  if (!Util.isUnset(request.callerIdNumber)) {
    query['CallerIdNumber'] = request.callerIdNumber;
  }
  if (!Util.isUnset(request.countryId)) {
    query['CountryId'] = request.countryId;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.playTimes)) {
    query['PlayTimes'] = request.playTimes;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sendType)) {
    query['SendType'] = request.sendType;
  }
  if (!Util.isUnset(request.speed)) {
    query['Speed'] = request.speed;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.timingStart)) {
    query['TimingStart'] = request.timingStart;
  }
  if (!Util.isUnset(request.ttsCode)) {
    query['TtsCode'] = request.ttsCode;
  }
  if (!Util.isUnset(request.ttsParam)) {
    query['TtsParam'] = request.ttsParam;
  }
  if (!Util.isUnset(request.voiceCode)) {
    query['VoiceCode'] = request.voiceCode;
  }
  if (!Util.isUnset(request.volume)) {
    query['Volume'] = request.volume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VoiceGroupCall',
    version = '2021-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 国际语音api-语音群呼
 *
 * @param request VoiceGroupCallRequest
 * @return VoiceGroupCallResponse
 */
async function voiceGroupCall(request: VoiceGroupCallRequest): VoiceGroupCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return voiceGroupCallWithOptions(request, runtime);
}

model VoiceSingleCallRequest {
  calledNumber?: string(name='CalledNumber', example='852****0000'),
  callerIdNumber?: string(name='CallerIdNumber', example='852****0001'),
  countryId?: string(name='CountryId', example='HK'),
  outId?: string(name='OutId', example='22522****'),
  ownerId?: long(name='OwnerId'),
  playTimes?: long(name='PlayTimes', example='2'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendType?: long(name='SendType', example='1'),
  speed?: long(name='Speed', example='0'),
  taskName?: string(name='TaskName', example='示例值示例值'),
  timingStart?: string(name='TimingStart', example='2022-05-01T08:00:00+08:00'),
  ttsCode?: string(name='TtsCode', example='1001'),
  ttsParam?: string(name='TtsParam', example='{"code":"1234"}'),
  voiceCode?: string(name='VoiceCode', example='1002'),
  volume?: long(name='Volume', example='100'),
}

model VoiceSingleCallResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='""'),
  code?: string(name='Code', example='OK'),
  message?: string(name='Message', example='OK'),
  model?: map[string]any(name='Model'),
  requestId?: string(name='RequestId', example='D9CB****-****-****-****-********9D23'),
  success?: boolean(name='Success', example='true'),
}

model VoiceSingleCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VoiceSingleCallResponseBody(name='body'),
}

/**
 * @summary 国际语音api-语音单呼
 *
 * @param request VoiceSingleCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return VoiceSingleCallResponse
 */
async function voiceSingleCallWithOptions(request: VoiceSingleCallRequest, runtime: Util.RuntimeOptions): VoiceSingleCallResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.callerIdNumber)) {
    query['CallerIdNumber'] = request.callerIdNumber;
  }
  if (!Util.isUnset(request.countryId)) {
    query['CountryId'] = request.countryId;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.playTimes)) {
    query['PlayTimes'] = request.playTimes;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sendType)) {
    query['SendType'] = request.sendType;
  }
  if (!Util.isUnset(request.speed)) {
    query['Speed'] = request.speed;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.timingStart)) {
    query['TimingStart'] = request.timingStart;
  }
  if (!Util.isUnset(request.ttsCode)) {
    query['TtsCode'] = request.ttsCode;
  }
  if (!Util.isUnset(request.ttsParam)) {
    query['TtsParam'] = request.ttsParam;
  }
  if (!Util.isUnset(request.voiceCode)) {
    query['VoiceCode'] = request.voiceCode;
  }
  if (!Util.isUnset(request.volume)) {
    query['Volume'] = request.volume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VoiceSingleCall',
    version = '2021-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 国际语音api-语音单呼
 *
 * @param request VoiceSingleCallRequest
 * @return VoiceSingleCallResponse
 */
async function voiceSingleCall(request: VoiceSingleCallRequest): VoiceSingleCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return voiceSingleCallWithOptions(request, runtime);
}

